import { DEFAULT_LAYOUT, PAGE_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const SETTING: AppRouteRecordRaw = {
  path: '/settingmanage',
  name: 'settingmanage',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: 'menu.settingManage',
    icon: 'icon-tool',
    requiresAuth: true,
    order: 1100,
  },
  children: [
    {
      path: '/region',
      name: 'Region',
      component: () => import('@/views/region/list.vue'),
      meta: {
        locale: 'menu.region',
        requiresAuth: true,
        roles: ['*'],
      },
    },
    {
      path: 'databasemanage',
      name: 'databasemanage',
      component: PAGE_LAYOUT,
      meta: {
        locale: 'menu.databaseManage',
        requiresAuth: true,
      },
      children: [
        {
          path: '/database/export',
          name: 'DatabaseExport',
          component: () => import('@/views/database/export.vue'),
          meta: {
            locale: 'menu.databaseExport',
            requiresAuth: true,
            roles: ['*'],
          },
        },
        {
          path: '/database/import',
          name: 'DatabaseImport',
          component: () => import('@/views/database/import.vue'),
          meta: {
            locale: 'menu.databaseImport',
            requiresAuth: true,
            roles: ['*'],
          },
        },
      ],
    },
    {
      path: '/setting',
      name: 'Setting',
      component: () => import('@/views/setting/index.vue'),
      meta: {
        locale: 'menu.setting',
        requiresAuth: true,
        roles: ['*'],
      },
    },
  ],
};

export default SETTING;
